body {
    font-family: Arial, sans-serif;
    background: #f5f7fa;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 标签页导航样式 */
.tab-nav {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: #f5f5f5;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    color: #666;
}

.tab-btn:hover {
    background: #e8f4fd;
    color: #4a90e2;
}

.tab-btn.active {
    background: white;
    color: #4a90e2;
    border-bottom-color: #4a90e2;
    font-weight: bold;
}

/* 标签页内容样式 */
.tab-content {
    min-height: 300px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.section {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.tab-pane .section {
    margin: 0;
    background: white;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

button {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.status, .action {
    text-align: center;
    margin: 20px 0;
}

/* 扫码状态提示 */
.scan-status {
    text-align: center;
    padding: 15px;
    background: #e8f4fd;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #4a90e2;
}

.scan-status p {
    margin: 5px 0;
}

.scan-hint {
    font-size: 14px;
    color: #666;
}

.scan-status.scanning {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.scan-status.success {
    background: #d4edda;
    border-left-color: #28a745;
}

.scan-status.error {
    background: #f8d7da;
    border-left-color: #dc3545;
}

/* 块状态网格显示 */
.chunk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 5px;
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.chunk-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chunk-box.received {
    background: #28a745;
    color: white;
    border-color: #1e7e34;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.chunk-box.missing {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

.chunk-box:hover {
    transform: scale(1.1);
}

/* 详细列表显示 */
.chunk-list {
    text-align: left;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    display: none;
}

.chunk-list.show {
    display: block;
}

#progressContainer {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

#log {
    margin-top: 20px;
    padding: 10px;
    background: #ffeaa7;
    border-radius: 5px;
    font-size: 14px;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .tab-btn {
        font-size: 12px;
        padding: 10px 8px;
    }
    
    #scanner {
        width: 100%;
        max-width: 280px;
        height: auto;
    }
    
    textarea {
        font-size: 14px;
    }
    
    button {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .tab-nav {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid #e0e0e0;
        border-radius: 0;
    }
    
    .tab-btn.active {
        border-bottom-color: #4a90e2;
        border-left: 3px solid #4a90e2;
    }
}